switchroot: Ensure /run/ostree-booted is created even without initramfs
authorColin Walters <walters@verbum.org>
Thu, 22 Mar 2018 14:14:22 +0000 (10:14 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 22 Mar 2018 19:02:29 +0000 (19:02 +0000)
commit38cf31f6a72a946a469a8fa649ade2193e041e9e
treecfd7f0feef39beb4427003c5cc5ebab8c654a65a
parent246a7a5cc21cefa57a908f4374a7e19766fb89cc
switchroot: Ensure /run/ostree-booted is created even without initramfs

See https://mail.gnome.org/archives/ostree-list/2018-March/msg00012.html

If ostree-prepare-root is run as pid 1 (i.e we're not using an initramfs), then
anything we write outside the target sysroot (such as `/run/ostree-booted`) will
be lost.

Since `ostree-remount.service` runs fairly early in boot, and is triggered via
`ConditionKernelCommandLine=ostree`, we can just touch the file there in
addition.

Closes: #1508
Approved by: akiernan
src/switchroot/ostree-mount-util.h
src/switchroot/ostree-prepare-root.c
src/switchroot/ostree-remount.c